package controllers;

import java.io.File;
import java.io.IOException;
import java.util.List;

import models.ImageData;

import org.apache.log4j.Logger;

import play.mvc.Controller;
import play.mvc.With;


public class Application extends Controller {
	
	static Logger logger = Logger.getLogger(Application.class);

    /*public static void index() {
    	Post frontPost = Post.find("order by publishDate desc").first();
        List<Post> olderPosts = Post.find(
            "order by publishDate desc"
        ).from(1).fetch(10);
        render(frontPost, olderPosts);
    }*/
    
    /*public static void gallery() {
    	List<ImageData> images = ImageData.findAll();
    	render(images);
    }*/
	
	public static void fileUpload() {
		List<ImageData> images = ImageData.findAll();
    	render(images);
	}
	
	public static void uploadImage(long id, String title, String comment, File[] photo) throws IOException {
		logger.info("Files: "+title);
		logger.info("Files: "+comment);
		logger.info("Files: "+photo.length);
		for (File file : photo) {
			logger.info("file path: "+file.getCanonicalPath());
		}
	}

}